<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
 function setCookie(key, value, iDay)
	{
			var oDate = new Date();
	
			oDate.setDate(oDate.getDate() + iDay);
		
			document.cookie = key +'='+value+';expires='  + oDate;
	}
	
	function getCookie(key)
	{
			var arr = document.cookie.split('; ');
			for(var i =0;i<arr.length;i++)
				{
						var arr2 = arr[i].split('=');
						if(arr2[0]==key)
							{
									return arr2[1];
							}
				}
			return '';
	}
	
	function removeCookie(key)
	{
				setCookie(key,1,-1);
	}
	
	removeCookie('user');
	
	alert(document.cookie);
	//alert(getCookie('user'));
	//setCookie('user','albert', 30);
	//setCookie('password', '123456', 14);
</script>
</head>

<body>
</body>
</html>
